import request from "@/utils/request.js";

// 获取用户动态
const getMomentListApi = data => {
	return request({
		url: "/moment/getUserMomentList",
		method: "POST",
		data,
	});
}; 

// 获取所有动态
const AllMomentListApi = () => {
	return request({
		url: "/moment/getAllMoment"
	});
}; 

// 获取指定动态
const getMomentByIdApi = data => {
	return request({
		url: "/moment/momentById",
		method: "POST",
		data,
	});
}; 

// 添加动态
const addMomentApi = data => {
	return request({
		url: "/moment/addMoment",
		method: "POST",
		data,
		header:{
			"content-type":"application/json"
		}
	});
};

// 查询步骤
const getStepsApi = data => {
	return request({
		url: "/moment/stepsByMomentId",
		method: "POST",
		data,
	});
};

// 查询所有标签
const getLabelListApi = () => {
	return request({
		url: "/moment/getLabelList",
	});
};


// 给动态点赞
const upvoteApi = data => {
	return request({
		url: "/moment/upvoteByMoment",
		method: "POST",
		data,
	});
};

export {
	getMomentListApi,
	addMomentApi,
	getStepsApi,
	getLabelListApi,
	upvoteApi,
	AllMomentListApi,
	getMomentByIdApi
};
